Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • what test to use*to analyze a categorical with continuous predictor for a categorical response?

    Hi,

    I'm a statistics newbie, so please be gentle

    I'm trying to figure out what test to use to analyze a categorical concurrent with continuous predictor for a categorical response.

    For example:

    How is hypertension with incrementally increasing age associated with overall death?

    I'm trying to determine if hypertension is associated with overall death to varying degrees depending on the patient's age
    i.e. As patients get older, they are more likely to die if they have hypertension than if they did not.
    I have both time to death (continuous) and event of death (categorical) data.

    All and any advice will be very much appreciated! thank you!

  • #2
    Trenton:
    welcome to the list.
    As far as I can get your query, you might be interested in something along the following lines:
    Code:
    . use http://www.stata-press.com/data/r14/drugtr.dta
    (Patient Survival in Drug Trial)
    
    . stcox i.drug##c.age, nolog
    
             failure _d:  died
       analysis time _t:  studytime
    
    Cox regression -- Breslow method for ties
    
    No. of subjects =           48                  Number of obs    =          48
    No. of failures =           31
    Time at risk    =          744
                                                    LR chi2(3)       =       33.33
    Log likelihood  =   -83.245435                  Prob > chi2      =      0.0000
    
    ------------------------------------------------------------------------------
              _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          1.drug |     .01956   .0840494    -0.92   0.360     4.30e-06    88.91912
             age |   1.106709   .0537957     2.09   0.037     1.006138    1.217332
                 |
      drug#c.age |
              1  |   1.029803   .0767888     0.39   0.694     .8897808     1.19186
    ------------------------------------------------------------------------------
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you much Mr. Lazzaro!^^

      Comment


      • #4
        As Carlo already pointed out, it seems the issue is fundamentally related to interaction.

        Therefore, as also in the example in #2, adding an interaction term can do the trick.

        Perhaps an example (from the same data set) with a graph would help as well:

        Code:
        . margins drug, at(age=(47(2)67))
        . marginsplot
        Best regards,

        Marcos

        Comment

        Working...
        X